package com.jd.controller;

import java.util.ArrayList;
import java.util.HashMap;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jd.entity.DetailedEntity;
import com.jd.service.DetailedService;

@Controller
@RequestMapping("/detailedController")
public class DetailedController {

	@Autowired
	private DetailedService detailedService;
	
	@RequestMapping("/getDetailed")
	@ResponseBody
	public ArrayList<DetailedEntity> getDetailed(HttpServletRequest request) {
		String userId = request.getSession().getAttribute("userId").toString();
		String flag = request.getParameter("flag");
		String type = request.getParameter("type");
		String fn = request.getParameter("fn");
		HashMap<String, Object> map = new HashMap<String,Object>();
		map.put("userId", userId);
		map.put("flag", flag);
		map.put("type", type);
		map.put("fn", fn);
		ArrayList<DetailedEntity> detailList=detailedService.getDetailedList(map);
		return detailList;
	}
}
